package com.kcht.sylyg08.ctrl;

import com.kcht.adp.common.log.Logger;
import com.kcht.adp.pagination.Page;
import com.kcht.adp.web.rs.AdpRest;
import com.kcht.sylyg08.service.ReaderService;
import com.kcth.sylyg08.entity.Reader;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.ws.rs.QueryParam;
import java.util.List;

@RequestScoped
@Transactional(Transactional.TxType.NOT_SUPPORTED)
public class ReaderCtrl {
    @Inject
    private Logger logger;

    @Inject
    private ReaderService service;

    @AdpRest(principal = "任务列表", permission = "任务列表")
    public void save(Reader reader) {
        service.save(reader);
    }

    @AdpRest(principal = "任务列表", permission = "任务列表")
    public Page<Reader, Reader> list(Page<Reader, Reader> page) {
        return service.list(page);
    }

    @AdpRest(principal = "任务列表", permission = "任务列表")
    public void delete(@QueryParam("ids") List<Integer> ids) {
        service.delete(ids);
    }
}
